home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @@;
-
-
- 1.2
- date 89.10.03.17.29.09; author shirriff; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 89.01.05.17.00.09; author ouster; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.2
- log
- @changed tmpname to tempnam.
- @
- text
- @' Copyright 1989 Regents of the University of California
- ' Permission to use, copy, modify, and distribute this
- ' documentation for any purpose and without fee is hereby
- ' granted, provided that this notice appears in all copies.
- ' The University of California makes no representations about
- ' the suitability of this material for any purpose. It is
- ' provided "as is" without express or implied warranty.
- '
- ' $Header: /sprite/src/lib/c/stdio/RCS/tmpnam.man,v 1.1 89/01/05 17:00:09 ouster Exp Locker: shirriff $ SPRITE (Berkeley)
- '
- .so \*(]ltmac.sprite
- .HS tmpnam lib
- .BS
- .SH NAME
- tmpnam, tempnam \- Generate unique names for temporary files
- .SH SYNOPSIS
- .nf
- \fBinclude <stdio.h>
-
- \fBchar *
- tmpnam(\fIs\fR)
-
- \fBchar *
- tempnam(\fIdir\fR, \fIprefix\fR)
- .SH ARGUMENTS
- .AS char *prefix
- .AP char *s in/out
- Place to store temporary file name. If \fBNULL\fR, store name in local
- static storage that will be overwritten on next call to \fBtmpnam\fR.
- If not \fBNULL\fR, \fIs\fR must point to a buffer containing
- at least \fBL_tmpnam\fR bytes.
- .AP char *dir in
- Directory in which to temporary file should reside. If \fBNULL\fR,
- or if \fIdir\fR is not an accessible directory, defaults to \fBP_tmpdir\fR.
- .AP char *prefix in
- First few letters to use for name of temporary file.
- .BE
-
- .SH DESCRIPTION
- .PP
- The procedures \fBtmpnam\fR and \fBtempnam\fR generate unique file
- names suitable for temporary files. Each procedure returns a pointer
- to the name it generated, except that under some conditions (such
- as inability to allocate memory, for example) \fBtempnam\fR will
- fail to generate a file name. When this happens, \fBtempnam\fR will
- return \fBNULL\fR.
- .PP
- \fBTmpnam\fR generates file names that refer to a standard directory
- defined by \fBP_tmpdir\fR (currently \fB/usr/tmp\fR). Each time
- \fBtmpnam\fR is called it will return a different file name, which
- does not refer to any existing file.
- .PP
- \fBTempnam\fR is similar to \fBtmpnam\fR except that it provides
- more flexibility. The \fIdir\fR argument may be used to specify
- a particular directory to which the generated name should refer.
- If this is not an accessible directory, then \fBP_tmpdir\fR will
- be used. If this directory is not accessible either, then
- \fB/tmp\fR will be used as a last resort. If the \fBTMPDIR\fR
- environment variable is defined and refers to an accessible
- directory, then it will override any of the above choices.
- .PP
- The \fIprefix\fR argument may be used to specify the first few letters
- of the last component of the path name generated by \fBtempnam\fR.
- \fBTempnam\fR dynamically allocates space for the name
- using \fBmalloc\fR. It is the responsibility of the caller to
- release this storage by passing the returned string to \fBfree\fR
- when it is no longer needed.
- .SH KEYWORDS
- file name, temporary, unique
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d9 1
- a9 1
- ' $Header: /sprite/lib/forms/RCS/proto.man,v 1.1 88/12/29 17:09:50 ouster Exp $ SPRITE (Berkeley)
- d15 1
- a15 1
- tmpnam, tmpname \- Generate unique names for temporary files
- @
-